package com.briup.day04;

import java.util.Scanner;

public class Test_If {
    public static void main01(String[] args) {
        Scanner sc = new Scanner(System.in);
        System.out.println("请输入两个整数");
        int a = sc.nextInt();
        int b = sc.nextInt();
        int max=a;
        if(a<b){
            max=b;
        }
        System.out.println(max);
    }

    public static void main02(String[] args) {
        Scanner sc = new Scanner(System.in);
        //普通闰年:每四年闰一次 且不能被100整除
        //世纪闰年:每400年闰一次
        System.out.println("请输入年份");
        int year = sc.nextInt();
        if((year%4==0&&year%100!=0)||(year%400==0)){
            System.out.println(year+"是闰年");
        }else{
            System.out.println(year+"不是闰年");
        }
    }

    public static void main03(String[] args) {
        Scanner sc=new Scanner(System.in);
        System.out.println("请输入成绩");
        int score=sc.nextInt();
        if(score>100){
            System.out.println("成绩不允许超过100");
        }else if(score>=90){
            System.out.println("优秀");
        }else if(score>=80){
            System.out.println("良好");
        }else if(score>=70){
            System.out.println("中等");
        }else if(score>=60){
            System.out.println("及格");
        }else if(score>=0){
            System.out.println("不及格");
        }else{
            System.out.println("成绩有误");
        }
    }

    public static void main(String[] args) {
        Scanner sc = new Scanner(System.in);
        System.out.println("input a hour: ");
        int hour = sc.nextInt();
        String message;
        if (hour >= 8 && hour < 12) {
            message = "早上好";
        } else if (hour >= 12 && hour < 14) {
            message = "中午好";
        } else if (hour >= 14 && hour < 18) {
            message = "下午好";
        } else {
            message = "晚上好";
        }
        System.out.println(message);
    }
}
